<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>练习</title>
</head>
<body>
    <input type="number" id="number">
    <button onclick="funNum()">提交数字</button>
    <input type="number" id="year">
    <button onclick="funYear()">提交年份</button>
</body>
        <script>
            function funNum(){
                var a=document.getElementById("number").value
                console.log(typeof a)
                if (a % 2 == 0){
                    document.write('你输入的是偶数')
                }else {
                    document.write('不是偶数')
                }
            }
             function funYear(){
                var a=document.getElementById("year").value
                if ((a % 4 == 0 && a%100!=0)||(a%400==0) ){
                    document.write('你输入的是闰年')
                }else {
                    document.write('输入的不是闰年')
                }
            }
        </script>
</html>